Skip to content

Add multioutput type check in getShaderNodes#2760

Merged
jstone-lucasfilm merged 4 commits intoAcademySoftwareFoundation:mainfrom
xipaja:multi-shader-output-bug
Jan 30, 2026
Merged

Add multioutput type check in getShaderNodes#2760
jstone-lucasfilm merged 4 commits intoAcademySoftwareFoundation:mainfrom
xipaja:multi-shader-output-bug

Conversation

@xipaja
Copy link
Contributor

@xipaja xipaja commented Jan 28, 2026

This fixes #2529

This issue stems from validation that the Shader node’s output type matches the Material node’s input type. It doesn't note a multioutput node as a matching type and returns an empty shaderNodes vector to the Graph Editor. It never creates a Material due to not receiving shaderNodes, leading to the empty Render View in the Editor. This then leads to a lack of renderable elements in the Viewer.

This change will check available activeOutputs for multiOutput nodes to ensure at least one active output is compatible with the input of the Material node (for example, surfaceshader to surfaceshader). It will maintain the previous behavior otherwise.

Tested with the test files from the original issue:

triple_output_fix

Copy link
Member

@jstone-lucasfilm jstone-lucasfilm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks like a good improvement to me, @xipaja! I'll give others a chance to weigh in as well, but I'd have no objections to including this in MaterialXCore.

@jstone-lucasfilm jstone-lucasfilm changed the title Add check for multioutput shader types when getting shader nodes Add check for multioutput types in getShaderNodes Jan 30, 2026
@jstone-lucasfilm jstone-lucasfilm changed the title Add check for multioutput types in getShaderNodes Add multioutput type check in getShaderNodes Jan 30, 2026
@jstone-lucasfilm jstone-lucasfilm merged commit 83db613 into AcademySoftwareFoundation:main Jan 30, 2026
33 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Multiple surfaceshader outputs failure

2 participants

Comments